<include file="Public/head"/>
<link type="text/css" rel="stylesheet" href="{:get_style_cdnurl()}paimai/yunying/plugin/select2/select2.css" />
<script src="{:get_style_cdnurl()}paimai/yunying/plugin/select2/select2.js" type="text/javascript"></script>
<script src="http://img1.isou365.cn/paimai/yunying/js/city.js" type="text/javascript"></script>
<style>
    .xuanzhe ul li .menDao1{width:300px;}
    .xuanzhe ul li .menDao1 a{display:block;background:#cecece;color:#303030;float:left;width:36px; text-align:center;height:20px; line-height:20px; cursor:pointer;}
    .xuanzhe ul li .menDao1 .menHover{ background:#20ab4f;color:#fff;}
</style>
<include file="Public/common_header"/>
<div class="mian">
    <include file="Public/sidebar" menu="shgl.4s店回车"/>
    <div class="mianR">
        <div class="listBox">
            <div class="yuList">
                <h3 class="cha">到店信息</h3>
                <div class="car_info">
                    <div class="car_no"><span style="font-size:14px;">拍卖单号：<b>{$detail.order_no}</b></span></div>
                    <table border="1" width="100%">
                        <tbody>
                            <tr>
                                <td colspan="4" style="background-color:#c1c1c1;font-size:14px;"><span>评估师信息</span></td>
                            </tr>
                            <tr>
                                <td width="11%" style="color:#898b8a;">评估师姓名</td>
                                <td width="39%">{$detail.checker_name}</td>
                                <td width="11%" style="color:#898b8a;">评估师电话</td>
                                <td width="39%">{$detail.checker_phone}</td>
                            </tr>
                        </tbody>
                    </table>

                    <table border="1" width="100%" style="margin-top:10px;">
                        <tbody>
                            <tr>
                                <td colspan="4" style="background-color:#c1c1c1;font-size:14px;">
                                    <span>车辆信息</span>
                                    <span style="float: right;margin-right: 20px;"><a style="color: #0000FF;text-decoration: underline;" href="/Car/report/car_id/{$detail.car_id}" target="_blank">检测报告</a></span>
                                </td>
                            </tr>
                            <tr>
                                <td width="11%" style="color:#898b8a;">车型</td>
                                <td width="39%">{$detail.model}</td>
                                <td width="11%" style="color:#898b8a;">排放标准</td>
                                <td width="39%">{$detail.emission}</td>
                            </tr>
                            <tr>
                                <td style="color:#898b8a;">初登日期</td>
                                <td>{$detail.first_reg_date}</td>
                                <td style="color:#898b8a;">颜色</td>
                                <td>{$detail.car_color}</td>
                            </tr>
                            <tr>
                                <td style="color:#898b8a;">表显里程</td>
                                <td>{$detail.pointer_mileage}万公里</td>
                                <td style="color:#898b8a;">车况级别</td>
                                <td>{$detail.composite_state}{$detail.accident_level}</td>
                            </tr>
                            <tr>
                                <td style="color:#898b8a;">车辆注册地</td>
                                <td>{$detail.first_reg_city}</td>
                                <td style="color:#898b8a;">车架号</td>
                                <td>{$detail.vin}</td>
                            </tr>
                            <tr>
                                <td style="color:#898b8a;">车牌号</td>
                                <td>{$detail.plate_prefix}{$detail.plate_suffix}</td>
                                <td style="color:#898b8a;">过户限制</td>
                                <td>{$detail.transfer_limit}</td>
                            </tr>
                            <tr>
                                <td style="color:#898b8a;">渠道来源</td>
                                <td>
                                    <if condition="$detail.comefrom neq ''">
                                        <?php if(empty($detail['comefrom_url'])):?>
                                        {$detail.comefrom}
                                        <?php else: ?>
                                        <a href="{$detail.comefrom_url}" target="_blank" rel="noreferrer">{$detail.comefrom}</a>
                                        <?php endif;?>
                                        <else/>
                                        未知
                                    </if>
                                </td>
                                <td style="color:#898b8a;">所在地</td>
                                <td>{$detail.location_area}</td>
                            </tr>
                        </tbody>
                    </table>
                    <table border="1" width="100%" style="margin-top:10px;">
                        <tbody>
                        <tr>
                            <td colspan="4" style="background-color:#c1c1c1;font-size:14px;"><span>拍卖信息</span></td>
                        </tr><tr>
                            <td width="11%" style="color:#898b8a;">竞拍结束时间</td>
                            <td width="39%">{$detail.bidding_end_time}</td>
                            <td width="11%" style="color:#898b8a;">拍卖最高价</td>
                            <td width="39%">{:format_money($detail['highest_price'])}元</td>
                        </tr>
                        <tr>
                            <td style="color:#898b8a;">保留价</td>
                            <td>{$detail.reserve_price}元</td>
                            <td style="color:#898b8a;">
                                <if condition="$detail.is_consult eq 1">磋商<else/>确认</if>成交价
                            </td>
                            <td>{:format_money($detail['owner_trade_price'])}元</td>
                        </tr>
                        <tr>
                            <td style="color:#898b8a;">公司补贴</td>
                            <td><?php echo $detail['company_subsidies'] > 0 ? $detail['company_subsidies']."元" : "无" ;?></td>
                            <td style="color:#898b8a;"></td>
                            <td></td>
                        </tr>

                        </tbody>
                    </table>
                    <table border="1" width="100%" style="margin-top:10px;">
                        <tbody>
                        <tr>
                            <td colspan="4" style="background-color:#c1c1c1;font-size:14px;">
                                <span>
                                    付款信息（{$detail.pay_status_name}）</if>
                                </span>
                            </td>
                        </tr>
                        <tr>
                            <td width="11%" style="color:#898b8a;">付款人</td>
                            <td width="39%">
                                {$detail.pay_man}
                            </td>
                            <td width="11%" style="color:#898b8a;">付款时间</td>
                            <td width="39%">
                                {$detail.pay_time}
                            </td>
                        </tr>
                        </tbody>
                    </table>
                    <table border="1" width="100%" style="margin-top:10px;">
                        <tbody>
                            <tr>
                                <td colspan="4" style="background-color:#c1c1c1;font-size:14px;"><span>回车信息</span></td>
                            </tr>
                            <tr>
                                <td width="11%" style="color:#898b8a;">加油要求</td>
                                <td width="39%">{$return_detail.refuel_demand}元</td>
                                <td width="11%" style="color:#898b8a;">代驾公司</td>
                                <td width="39%">{$return_detail.driver_company}</td>
                            </tr>
                            <tr>
                                <td style="color:#898b8a;">代驾姓名</td>
                                <td>{$return_detail.driver_name}</td>
                                <td style="color:#898b8a;">代驾电话</td>
                                <td>{$return_detail.driver_phone}</td>
                            </tr>
                            <tr>
                                <td style="color:#898b8a;">代驾出发时间</td>
                                <td>{$return_detail.depart_time}</td>
                                <td style="color:#898b8a;">开票要求</td>
                                <td>{$return_detail.invoice}元</td>
                            </tr>
                            <tr width="100%">
                                <td style="color:#898b8a;">车钥匙</td>
                                <td>{$return_detail.carkey}把</td>
                                <td style="color:#898b8a;">交付门店</td>
                                <td>{$return_detail.delive_store_str}</td>
                            </tr>
                            <tr>
                                <td style="color:#898b8a;">回车手续</td>
                                <td colspan="4">{$return_detail.procedure}</td>
                            </tr>
                            <!--<tr>-->
                                <!--<td style="color:#898b8a;">手续上传要求</td>-->
                                <!--<td colspan="4">{$return_detail.procedures_upload}</td>-->
                            <!--</tr>-->
                            <tr>
                                <td style="color:#898b8a;">车辆补充说明</td>
                                <td colspan="4">{$return_detail.desc}</td>
                            </tr>
                            <tr>
                                <td style="color:#898b8a;">回车备注</td>
                                <td colspan="4">{$return_detail.return_remark}</td>
                            </tr>
                        </tbody>
                    </table>
                    <br/>
                    <?php if($return_detail['status'] > 1):?>
                    <h3 class="cha">手续上传要求</h3>
                    <div class="transfer-want">
                        <div class="transfer-front clearfix">
                            <?php if(!empty($beforeTransfer)):?>
                            <dl class="clearfix" style="height: 310px;">
                                <dt style="height: 310px;">
                                    <span style="margin-top: 134px;">过户前</span>
                                </dt>
                                <dd>
                                    <ul >
                                        <?php foreach($beforeTransfer as $pb):?>
                                        <li data-id="1" class="clearfix">
                                            <span>{$pb.certificate_name}</span>
                                            <input type="button" class="<?php echo ($pb['certificate_image_type']==1 || $pb['certificate_image_type']==3) ? 'current' : '' ;?>" data-id="1" value="照片" >
                                            <input type="button" class="<?php echo ($pb['certificate_image_type']==2 || $pb['certificate_image_type']==3) ? 'current' : '' ;?>" data-id="2" value="扫描件">
                                        </li>
                                        <?php endforeach;?>
                                    </ul>
                                </dd>
                            </dl>
                            <?php else:?>
                            <dl class="clearfix" style="height: 310px;">
                                <dt style="height: 310px;">
                                    <span style="margin-top: 134px;">过户前</span>
                                </dt>
                                <dd class="not-upload">
                                    无上传要求
                                </dd>
                            </dl>
                            <?php endif;?>
                            <?php if(!empty($afterTransfer)):?>
                            <dl class="clearfix" style="margin-left:25px;">
                                <dt style="height: 310px;"><span style="margin-top: 134px;">过户后</span></dt>
                                <dd>
                                    <ul>
                                        <?php foreach($afterTransfer as $pa):?>
                                        <li data-id="2" class="clearfix">
                                            <span>{$pa.certificate_name}</span>
                                            <input type="button" class="<?php echo ($pa['certificate_image_type']==1 || $pa['certificate_image_type']==3) ? 'current' : '' ;?>" data-id="1" value="照片" >
                                            <input type="button" class="<?php echo ($pa['certificate_image_type']==2 || $pa['certificate_image_type']==3) ? 'current' : '' ;?>" data-id="2" value="扫描件">
                                        </li>
                                        <?php endforeach;?>
                                    </ul>
                                </dd>
                            </dl>
                            <?php else:?>
                            <dl class="clearfix" style="height: 310px;">
                                <dt style="height: 310px;">
                                    <span style="margin-top: 134px;">过户后</span>
                                </dt>
                                <dd class="not-upload">
                                    无上传要求
                                </dd>
                            </dl>
                            <?php endif;?>
                        </div>
                    </div>
                    <?php endif;?>
                    <if condition="$return_detail.status eq 2">
                        <table border="1" width="100%" style="margin-top:10px;">
                            <tbody>
                                <tr>
                                    <td colspan="4" style="background-color:#c1c1c1;font-size:14px;"><span>到店信息</span></td>
                                </tr><tr>
                                    <td width="11%" style="color:#898b8a;">车辆到店时间</td>
                                    <td width="39%">{$return_detail.arrival_time}</td>

                                </tr>
                                <tr>
                                    <td style="color:#898b8a;">到店备注</td>
                                    <td>{$return_detail.arrival_remark}</td>
                                </tr>
                            </tbody>
                        </table>
                    </if>
                </div>
            </div>
        </div>

        <if condition="$return_detail.status eq 1">
            <div class="shop_details">
                <ul>
                    <li>
                        <span>*车辆到店时间</span>
                        <em><input id="arrival_time" type="text" name="trace_start_time" value="" placeholder="请选择车辆到店时间" readonly="" class="driving_time"></em>
                    </li>
                    <li>
                        <span>备注</span>
                        <textarea id="remark" class="remarks_text"></textarea>
                    </li>
                </ul>
            </div>
            <div class="yongBtn">
                <input id="submitForm" type="button" value="确定" class="queding">
                <input type="button" onclick="history.back();" class="quxiao" value="返回">
            </div>
        <else/>
            <div class="yongBtn1">
                <input type="button" onclick="window.close();" class="quxiao" value="关闭">
            </div>
        </if>
    </div>
    <div class="clear"></div>
</div>
<script>
    $(document).ready(function(){
        $(".driving_time").ymdateplugin({
            showTimePanel: true,
            changeMonth: true,
            changeYear: true
        });


        $('#submitForm').click(function() {

            var arrival_time = $("#arrival_time").val();
            if(arrival_time==''){
                shibai_alert2("请选择车辆到店时间时间!");
                return;
            }

            var remark = $("#remark").val();
            var postData = {
                "order_id":"{$detail.order_id}",
                "arrival_time":arrival_time,
                "remark":remark
            };
            $(".yunBei").css("display",'block');
            $(".loading").fadeIn();
            $.post('/CarReturn/confirm_arrive',postData,function (data) {
                if(data.code!=200){
                    $(".loading").hide()
                    shibai_alert2(data.msg,1500)
                    return false;
                }
                btn_alert("操作成功",1500,function () {
                    window.location.href="/CarReturn/index";
                });
            },'json');
        });
    });
</script>
<include file="Public/foot" />